package com.project.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.bean.BuyDetailBean;
import com.project.bean.BuyOrderBean;
import com.project.mapper.IBuyOrderMapper;
import com.project.service.IBuyOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
import java.util.List;

@Service
@Transactional
public class BuyOrderServiceImpl implements IBuyOrderService {
    @Autowired
    private IBuyOrderMapper mapper;

    @Override
    public IPage<BuyOrderBean> cutByItem(Integer pageNO, String sName, LocalDate startDate, LocalDate endDate) {
        return mapper.cutByItem(new Page(pageNO, 3), sName, startDate, endDate);
    }

    @Override
    public BuyOrderBean findDetailByOrderId(Integer buyOrderId) {
        return mapper.findDetailByOrderId(buyOrderId);
    }

}
